#ifndef _UART_DRIVER_H
#define _UART_DRIVER_H

#include <jni.h>

#define SYS_FILE_PATH "/sys"

#if DEBUG_USB_SERIAL_PRINTF_ENBALE == 0x01
#define DEBUG_USB_SERIAL_PRINTF_LOGD LOGD
#else
#define DEBUG_USB_SERIAL_PRINTF_LOGD(a) {}
#endif

extern int init_serial(unsigned char * pfile,int nspeed);
extern int usb_serial_init_by_channel(uint8_t *channel);
extern int deinit_serial(int fd);

extern int set_opt(int fd,int nSpeed, int nBits, char nEvent, int nStop);

extern int serial_send_data(int fd , unsigned char *sendbuff,int len);
extern int serial_recv_data(int fd , unsigned char *recvbuff,int len,uint32_t timeout);
#endif
